import { useContext } from "react";
import { LayoutContext } from "../contexts/LayoutContext";

// 创建自定义hook用于访问上下文
export function useLayout() {
  const context = useContext(LayoutContext);
  if (!context) {
    throw new Error("useLayout must be used within a LayoutProvider");
  }
  return context;
}